9a2a1e705c8cb1a4a6e704941a9459dddd07397a,src/org/pentaho/di/trans/steps/salesforceupsert/SalesforceUpsert.java,SalesforceUpsert,writeToSalesForce,#Object[]#,133
Before Change
{
try {
if (log.isDetailed()) logDetailed("Called writeToSalesForce with " + data.iBufferPos + " out of " + meta.getBatchSizeInt());
// if there is room in the buffer
if ( data.iBufferPos < meta.getBatchSizeInt()) {
// build the XML node
MessageElement[] arNode = new MessageElement[data.nrfields];
int index=0;
for ( int i = 0; i < data.nrfields; i++) {
arNode[index++] = newMessageElement( meta.getUpdateLookup()[i], rowData[data.fieldnrs[i]]);
}
//build the SObject
SObject sobjPass = new SObject();
sobjPass.set_any(arNode);
sobjPass.setType(data.realModule);
//Load the buffer array
data.sfBuffer[data.iBufferPos] = sobjPass;
data.outputBuffer[data.iBufferPos] = rowData;
data.iBufferPos++;
}
if ( data.iBufferPos >= meta.getBatchSizeInt()) {
if (log.isDetailed()) logDetailed("Calling flush buffer from writeToSalesForce");
flushBuffers();
}
} catch (Exception e) {
throw new KettleException("\nFailed in writeToSalesForce: "+ e.getMessage());
}
}
After Change
{
try {
if (log.isDetailed()) logDetailed(BaseMessages.getString(PKG, "SalesforceUpsert.CalledWrite", data.iBufferPos, meta.getBatchSizeInt()));
// if there is room in the buffer
if ( data.iBufferPos < meta.getBatchSizeInt()) {
// build the XML node
MessageElement[] arNode = new MessageElement[data.nrfields];
int index=0;
for ( int i = 0; i < data.nrfields; i++) {
arNode[index++] = newMessageElement( meta.getUpdateLookup()[i], rowData[data.fieldnrs[i]]);
}
//build the SObject
SObject sobjPass = new SObject();
sobjPass.set_any(arNode);
sobjPass.setType(data.realModule);
//Load the buffer array
data.sfBuffer[data.iBufferPos] = sobjPass;
data.outputBuffer[data.iBufferPos] = rowData;
data.iBufferPos++;
}
if ( data.iBufferPos >= meta.getBatchSizeInt()) {
if (log.isDetailed()) logDetailed("Calling flush buffer from writeToSalesForce");
flushBuffers();
}
} catch (Exception e) {
throw new KettleException(BaseMessages.getString(PKG, "SalesforceUpsert.FailedInWrite", e.getMessage()));
}
}